import java.util.*;

public class Example01 {
    public static void main(String[] args) {
        ArrayList<String> arrayList = new ArrayList<>();
        arrayList.add("stu1：第一条字符串");
        arrayList.add("stu1：第二条字符串");
        arrayList.add("stu1：第三条字符串");
        arrayList.add("stu1：第四条字符串");
        System.out.println("集合长度" + arrayList.size());
        System.out.println("第二元素是" + arrayList.get(1));
//        arrayList.remove(0);
//        System.out.println(arrayList.size());
//        arrayList.clear();
//        System.out.println(arrayList.size());
//        arrayList.indexOf(0);
//        System.out.println(arrayList.size());
//        arrayList.lastIndexOf(3);
//        System.out.println(arrayList.size());
        for (int i=0; i<arrayList.size();i++){
            if (arrayList.get(i).contains("字符串")){
                System.out.println(i);
            }
        }
        for (String s :arrayList){
            System.out.println(s);
        }


     }


}



